package com.sparrow.source.common.dto.convert;

import com.sparrow.source.common.dto.UnvDeviceInfo;
import com.sparrow.source.persistense.UnvDevice;
import org.springframework.stereotype.Component;

/**
 * unv数据转换
 *
 * @author bryceyung
 * @since 2024/11/19
 */
@Component
public class UnvDeviceConvert {

    public UnvDevice convert2DataSource(UnvDeviceInfo deviceInfo) {
        UnvDevice device = new UnvDevice();
        device.setDeviceModel(deviceInfo.getDeviceModel());
        device.setFirmwareVersion(deviceInfo.getFirmwareVersion());
        device.setHardwareId(deviceInfo.getHardewareID());
        device.setMac(deviceInfo.getMac());
        device.setManufacturingDate(deviceInfo.getManufacturingDate());
        device.setPcbVersion(deviceInfo.getPCBVersion());
        device.setUbootVersion(deviceInfo.getUbootVersion());
        device.setSerialNumber(deviceInfo.getSerialNUmber());
        return device;
    }
}
